#ifndef _NE_RANDOM_H_
#define _NE_RANDOM_H_

#include <mathematics/Math.h>

namespace ne
{
    enum RandomSeedType
    {
        RST_ANY,
        RST_TIME,
        RST_SPECIFY
    };

    class NEAPI Random
    {
        public:
            Random();

            Random(const Random &random);

            Random& operator = (const Random &random);

            void setSeedType(const RandomSeedType rst);

            RandomSeedType getSeedType() const;

            void setTimeSeed();

            void setSeed(const uint32_t seed);

            uint32_t getSeed() const;

            uint32_t getCurrentSeed() const;

            // The result range [0, MAX_RAND_NUMBER]
            int randInt();

            int randInt(const int end);

            int randInt(const int begin, const int end);

            // The result range [0.0, 1.0]
            real randReal();

            real randReal(const real end);

            real randReal(const real begin, const real end);

            bool randBool();

            ~Random();

        public:
            static void RandTimeSeed();

            static void RandSeed(const uint32_t seed);

            // The result range [0, MAX_RAND_NUMBER]
            static int RandInt();

            static int RandInt(const int end);

            static int RandInt(const int begin, const int end);

            // The result range [0.0, 1.0]
            static real RandReal();

            static real RandReal(const real end);

            static real RandReal(const real begin, const real end);

            static bool RandBool();

        public:
            static const uint32_t MAX_RAND_NUMBER;

        private:
            RandomSeedType mSeedType;
            uint32_t mSeed;
            uint32_t mCurrentSeed;
    };
}

#endif
